from __future__ import unicode_literals
from mongoengine import *
from AnalysisService.MMKeyUtil import AVISONY_ENTRY_COLLECTION


class AYEntryModel(Document):
    euid = StringField(max_length=64)
    name = StringField(max_length=200)
    phonenumber = StringField(max_length=45)
    source = StringField(max_length=20)
    url = StringField(max_length=200)
    remark1 = StringField(max_length=500)
    remark2 = StringField(max_length=500)
    createtime = DateTimeField()

    meta = {
        'collection': AVISONY_ENTRY_COLLECTION,  # 设置集合名称
        'strict': False,
    }  # 数据库中的集合

    def __unicode__(self):
        return self.phonenumber


# {
#             "euid": UuidUtil.toStr(),
#             "name": name,
#             "phonenumber": phonenumber,
#             "source": source,                     # 来源 wap/pc
#             "url": url,                           # 当前url
#             "remark1": remark1,
#             "remark2": remark2,
#             "createtime": DateFormatUtil.format()
#         }